package com.remoter.basic.bean.support;

import com.remoter.basic.bean.AbstractModule;
import com.remoter.basic.util.Final;

/**
 * @author			koko
 * @date 			2017-08-08 14:18:41
 * @description 	类功能说明
 */
public class ConsumerModule extends AbstractModule{

	private static final long serialVersionUID = 6966464563687002007L;
	private transient Object proxy;
	private String remoteHost;
	private int remotePort;
	private String loadBalance = Final.D_VAL_CONSUMER_LOADBALANCE;
	
	public Object getProxy() {
		return proxy;
	}

	public void setProxy(Object proxy) {
		this.proxy = proxy;
	}

	public String getRemoteHost() {
		return remoteHost;
	}

	public void setRemoteHost(String remoteHost) {
		this.remoteHost = remoteHost;
	}

	public int getRemotePort() {
		return remotePort;
	}

	public void setRemotePort(int remotePort) {
		this.remotePort = remotePort;
	}
	public String getLoadBalance() {
		return loadBalance;
	}

	public void setLoadBalance(String loadBalance) {
		this.loadBalance = loadBalance;
	}

	@Override
	public boolean isProvider() {
		return false;
	}

	@Override
	public boolean isConsumer() {
		return true;
	}
	
	public ConsumerModule cloneInstance(){
		ConsumerModule module = new ConsumerModule();
		module.setBean(this.getBean());
		module.setHost(this.getHost());
		module.setPort(this.getPort());
		module.setProtocol(this.getProtocol());
		module.setProxy(this.getProxy());
		module.setRemoteHost(this.getRemoteHost());
		module.setRemotePort(this.getRemotePort());
		module.setServer(this.getServer());
		module.setType(this.getType());
		module.setLoadBalance(this.getLoadBalance());
		return module;
	}
	
}